package com.zbf.设计模式1.代理模式1.动态代理1.JDK动态代理;

import java.lang.reflect.Proxy;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/20  15:55
 * 描述:
 */
public class TestJDKDaili {

    public static void main(String[] args) {

   /*     TestInterface testInterface=new TestInterfaceImpl();
        Test1InvioactionHandler<TestInterface> test1InvioactionHandler=new Test1InvioactionHandler<>(testInterface);
        TestInterface yyy = (TestInterface)Proxy.newProxyInstance(TestInterface.class.getClassLoader(), testInterface.getClass().getInterfaces(), test1InvioactionHandler);
        String s = yyy.test01("2222");
        System.out.println(s);
*/


        Test2InvocationHandler test2InvocationHandler=new Test2InvocationHandler();
        Class<TestInterface2>[] testInterface2Class= new Class[]{TestInterface2.class};
        TestInterface2 uuuu =(TestInterface2)Proxy.newProxyInstance(TestInterface2.class.getClassLoader(),testInterface2Class , test2InvocationHandler);
        TestImpl.test3(uuuu);


    }

}
